import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'home',
        component: () => import('../views/home/index.vue')
    },
    {
        path: '/about',
        name: 'about',
        component: () => import('../views/about/index.vue')
    },
    {
        path:'/404',
        component: () => import('../views/404View/index.vue')
    },
    {
        path: '/:pathMatch(.*)*', // 定义 catch-all 路由,
        redirect:'/404'
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router